﻿using Abp.Application.Navigation;
using Abp.Localization;
using Akso.Authorization;
using Akso.Web.Navigation;

namespace Akso.Web.Areas.BasicData.Startup
{
    public class BasicDataNavigationProvider : NavigationProvider
    {
        public const string MenuName = "BasicData";
        
        public override void SetNavigation(INavigationProviderContext context)
        {
            var menu = context.Manager.Menus[MenuName] = new MenuDefinition(MenuName, new FixedLocalizableString("BasicData Menu"));

            menu
                .AddItem(new MenuItemDefinition(
                    PageNames.App.Business.BasicData,
                    L("Menu_BasicData"),
                    icon: "icon-wrench"
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.Business.Vendors,
                        L("Menu_BasicData.Vendors"),
                        url: "BasicData/Vendors",
                        icon: "icon-layers",
                        requiredPermissionName: AppPermissions.Pages_BasicData_Vendors,
                        order: 0
                        )
                    )
                );
        }

        private static ILocalizableString L(string name)
        {
            return new LocalizableString(name, AbpZeroTemplateConsts.LocalizationSourceName);
        }
    }
}